package com.burger.service;

import com.burger.domain.Book;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional
public interface BookService {
    /**
     * 添加图书
     * @param book
     * @return
     */
    public boolean save(Book book);

    /**
     * 修改图书
     * @param book
     * @return
     */
    public boolean update(Book book);

    /**
     * 删除图书
     * @param id
     * @return
     */
    public boolean delete(Integer id);

    /**
     * 按id查找图书
     * @param id
     * @return
     */
    public Book getById(Integer id);

    /**
     * 查询全部图书
     * @return
     */
    public List<Book> getAll();

    /**
     * 增加图书
     * @return
     */
    public boolean up(Integer id);

    /**
     * 减少图书
     * @return
     */
    public boolean down(Integer id);
}
